package org.awa.demo.opencv.util;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class TicketUtil {

    private long preTicket;

    public TicketUtil(){
        preTicket = System.currentTimeMillis();
        log.info("time record start : {}",preTicket);
    }

    public void ticket(String preMsg){
        long nowTicket = System.currentTimeMillis();
        long result = nowTicket - preTicket;
        this.preTicket = System.currentTimeMillis();
        log.info("time record {} : {}",preMsg,result);
    }

    public void close(){
        log.info("time record end : {}",System.currentTimeMillis());
    }

}
